﻿
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Threading;
using System.Globalization;
using BenzInfo.Hockey.LHRAF.Models;

namespace BenzInfo.Hockey.LHRAF.Controllers
{
    public class BaseController : Controller
    {
        //
        // GET: /Base/

        protected override void ExecuteCore()
        {
            string lang = (string)Session["lang"] ?? "fr";

            Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture(lang);

            LHRAFContext db = new LHRAFContext();

            ViewBag.Posts = db.Posts; 
            
            ViewBag.Lang = lang;

            //ViewBag.CurrentUser = null;
            ViewBag.CurrentUser = (User)Session["User"];
           // ViewBag.CurrentUser = db.Users.First();

            base.ExecuteCore();
        }
        public class SubmitResult
        {
            public string message;
            public bool success;
        }

    }
}
